#pragma once

#include "Token.h"
#include "Buffer.hpp"

namespace cal
{

class TokenStream
{
public:
    TokenStream(std::istream& is);
    ~TokenStream() = default;

public:
    bool eof() const { return _buffer.empty() && _eof; }
    Token get();
    Token peek(); 
    void putback(const Token& token); 

private:
    std::istream& _is;
    bool          _eof;
    Buffer<Token> _buffer;
    line_t        _line;
    col_t         _col;
};

}   // namespace cal
